<header class="main-header">
    <!-- Header Navbar -->
    <nav class="navbar">
        <div class="container">
            <div class="navbar-header">
                <a class="navbar-brand" href="{{ url.index }}">天一总局</a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    {% for menus in nav_menu %}
                        {% if menus|length == 1 %}
                            <li><a href="#">{{ menus[0].name }}</a></li>
                        {% else %}
                            <li class="dropdown">
                                <a href="#aaa" class="dropdown-toggle" data-toggle="dropdown" role="button"
                                >{{ menus[0].name }} <span class="caret"></span></a>
                                <ul class="dropdown-menu">
                                    {% for key,nav in menus if key != 0 %}
                                        <li><a href="#">{{ nav.name }}</a></li>
                                    {% endfor %}
                                </ul>
                            </li>
                        {% endif %}
                    {% endfor %}
                </ul>
            </div>
        </div>
    </nav>
</header>